package com.offcn.controller;

import com.offcn.mapper.AccountMapper;
import com.offcn.pojo.Account;
import com.offcn.service.BankService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/test")
@RestController
public class TestController {

    @Autowired
    private AccountMapper accountMapper;

    @Autowired
    private BankService bankService;

    @GetMapping("/selectAll")
    public List<Account> selectAll(){
        return accountMapper.selectAll();
    }

    @GetMapping("/selectOne")
    public Account selectOne(@RequestParam("id") Integer id){
        return bankService.selectOne(id);
    }
}
